<%@ Import Namespace="Microsoft.Web.Mvc" %>
<%@ Import Namespace="FlickrPortfolio.Helpers" %>
<%@ Import Namespace="FlickrPortfolio.Models"%>

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IList<Photo>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Index</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>
    
    <% foreach (var photo in Model) { %>
        <div class="photo" id="<%= photo.ID %>">
            <a href="<%= Url.Action("Show", new {id=photo.ID}) %>"><img src="<%= photo.Urls.Where(x => x.UrlType == UrlType.Small).First().Url %>" alt="<%= photo.Title %>" class="photo" /></a>
            <%= Html.ActionLink(photo.Title, "Show", new {id=photo.ID}) %>
        </div>
    <% } %>

</asp:Content>
